import { createRouter, createWebHistory } from 'vue-router'
import HomeView from '../views/HomeView.vue'

const routes = [
  {
    path: '/',
    redirect: "/home"
  },
  {//首页
    path: '/home',
    name: 'home',
    component: HomeView
  },
  {//书架
    path: '/bookshelf',
    name: 'bookshelf',
    component: () => import('../views/bookShelf.vue')
  },
  // {//分类
  //   path: '/fication',
  //   name: 'fication',
  //   component: () => import('../views/ficationView.vue')
  // },
  {//赚钱
    path: '/make',
    name: 'make',
    component: () => import('../views/makeView.vue')
  },
  {//个人主页
    path: '/my',
    name: 'my',
    component: () => import('../views/myView.vue')
  },
  {//排行榜
    path: '/leaderboard',
    name: 'leaderboard',
    component: () => import('../views/leaderBoard.vue')
  },
  {//小说详情
    path: '/details',
    name: 'details',
    component: () => import('../views/DetailsPage.vue')
  },
  {//更多评论
    path: '/morecom',
    name: 'morecom',
    component: () => import('../views/moreComments.vue')
  },
  {//回贴（展开评论）
    path: '/replies',
    name: 'replies',
    component: () => import('../views/RepliesView.vue')
  },
  {//搜索
    path: '/searchView',
    name: 'searchView',
    component: () => import('../views/searchView.vue')
  },
  {//搜索结果
    path: '/resultView',
    name: 'resultView',
    component: () => import('../views/resultView.vue')
  },
  {//会员充值
    path: '/member',
    name: 'member',
    component: () => import('../views/memberView.vue')
  },
  {//登录注册
    path: '/login',
    name: 'login',
    component: () => import('../views/loginView.vue')
  },
  {//小说内容
    path: '/novel',
    name: 'novel',
    component: () => import('../views/novelContent.vue')
  },
  {//搜索数据列表
    path: '/searchlist',
    name: 'searchlist',
    component: () => import('../views/SearchList.vue')
  },
  {//历史记录
    path: '/history',
    name: 'history',
    component: () => import('../views/HistoryView.vue')
  },
   {//作者信息
    path: '/authorView',
    name: 'authorView',
    component: () => import('../views/authorView.vue')
  },
   {//充值
    path: '/krypton',
    name: 'krypton',
    component: () => import('../views/KryptonView.vue')
  },
     {//现金
      path: '/cash',
      name: 'cash',
      component: () => import('../views/CashView.vue')
    },
     {//广告
      path: '/advertisementView',
      name: 'advertisementView',
      component: () => import('../components/advertisementView.vue')
    },
      {//分类帅选
        path: '/CartypesView',
        name: 'CartypesView',
        component: () => import('../views/CartypesView.vue')
      },
]

const router = createRouter({
  history: createWebHistory(process.env.BASE_URL),
  routes,
  scrollBehavior() {
    return { top: 0 }//跳转默认置顶
    
  },
})




export default router
